import request from '@/utils/request'

interface VoiceToTextResponse {
  status: string
  code: number
  message: string
  payload: {
    text: string
  }
}

/**
 * 语音转文本
 */
export const voiceToText = (data: FormData): Promise<VoiceToTextResponse> => {
  return request({
    url: `/v3/audio_upload`,
    headers: {
      'Content-Type': 'multipart/form-data',
    },
    method: 'post',
    data,
  })
}
